home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-25 | 3.2 KB | 101 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: ToolFrm.h
- // Release Version: $ ODF 1 $
- //
- // Author: Henri Lamiraux
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef TOOLFRM_H
- #define TOOLFRM_H
-
- #ifndef UTILS_H
- #include "Utils.h"
- #endif
-
- #ifndef FLOATFRM_H
- #include "FloatFrm.h"
- #endif
-
- //========================================================================================
- // Constants
- //========================================================================================
-
- const unsigned short kToolCellSize = 21;
-
- const unsigned short kToolWidth = 1 + kToolCellSize + 1 + kToolCellSize + 1;
- const unsigned short kToolHeight = 1 + kToolCellSize + 1 + kToolCellSize + 1 + kToolCellSize + 1;
-
- const unsigned short kSelectorHeight = 12;
- const short kFillFrameSelectorPos = 2 + kToolHeight + 2;
-
- const unsigned short kColorSelectorWidth = kToolWidth - 4;
- const unsigned short kColorSelectorHeight = 30;
-
- const unsigned short kToolsWindowWidth = 2 + kToolWidth + 2;
- const unsigned short kToolsWindowHeight = 2 + kToolHeight + 2 + kSelectorHeight + 2 + 2 + 4 + kColorSelectorHeight + 4;
-
- //========================================================================================
- // Forward Declaration
- //========================================================================================
-
- class FW_CMouseEvent;
- class FW_CGraphicContext;
-
- //========================================================================================
- // CToolFrame
- //========================================================================================
-
- class CToolFrame : public CFloatingWindowFrame
- {
- //----------------------------------------------------------------------------------------
- // Initialization/destruction
- //
- public:
-
- FW_DECLARE_AUTO(CToolFrame)
-
- CToolFrame(Environment *ev, ODFrame* odFrame, FW_CPresentation* presentation, CDrawPart* drawPart);
- virtual ~ CToolFrame();
-
- //----------------------------------------------------------------------------------------
- // Inherited
- //
- public:
- virtual void Draw(Environment *ev, ODFacet* odFacet, ODShape* invalidShape);
- virtual FW_Boolean DoMouseDown(Environment *ev, const FW_CMouseEvent& theMouseEvent);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- void CheckTool(Environment *ev,
- unsigned short oldTool,
- unsigned short newTool);
- void CheckRenderVerb(Environment *ev,
- unsigned short oldRenderVerb,
- unsigned short newRenderVerb);
- void UpdateColors(Environment *ev);
-
- private:
- void InvertTool(FW_CGraphicContext& gc, unsigned short theTool, FW_Boolean state);
- void DrawRenderVerb(FW_CGraphicContext& gc,
- unsigned short renderVerb,
- const FW_CColor& color);
- void DrawTools(FW_CGraphicContext& gc);
- void DrawColors(FW_CGraphicContext& gc);
-
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- CGrid fToolGrid;
- CGrid fFillFrameGrid;
- };
-
- #endif
-